<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
  
  <title>The simple Real Time Java: Embedded Artists LPC2106-RS232</title><link rel="stylesheet" type="text/css" href="styles.css"></head>
<body>
<table style="border-width: 0pt; border-collapse: collapse; width: 900px; height: 12px;" id="AutoNumber1" border="0" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td style="border-style: none; border-width: medium;" bgcolor="#1f68a5" height="17" width="100%">
      <table style="border-width: 0pt; border-collapse: collapse; width: 900px; height: 81px;" id="AutoNumber6" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td style="border-style: none; border-width: medium; height: 79px; width: 400px; background-color: rgb(153, 0, 0); vertical-align: middle;">
            <p style="margin-left: 7px; margin-top: 0pt; margin-bottom: 0pt;" align="left"> <br>
            <span style="letter-spacing: -1px;"><b> <font color="#ffffff" face="Verdana" size="6">RTJ Computing</font></b></span><br>
            &nbsp;</p>
            </td>
            <td style="border-style: none; border-width: medium; height: 79px; width: 500px; background-color: rgb(153, 0, 0); background-image: url(images/header.png);">
            <p style="margin-left: 50px; text-align: left;">
              <big><i><font color="#ffcc00" face="Verdana">simple</font></i><font style="font-weight: bold;" color="#ffcc00" face="Verdana"><big>RTJ</big></font></big>
              <br>
            <small><font color="#ffcc00" face="Verdana">a small footprint Java VM for embedded and consumer devices</font></small>
            </p>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
    <tr>
      <td style="border: medium none rgb(204, 0, 0);" bgcolor="#ffcc66" height="16" width="100%">
      <table style="border-collapse: collapse; border-top-width: 0pt; width: 900px; height: 6px;" id="AutoNumber11" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td style="border-right: 1px solid rgb(153, 0, 0); height: 4px; text-align: center; background-color: rgb(204, 0, 0); width: 20%;">
            <p style="margin-top: 2px; margin-bottom: 2px;"><a href="http://rtjcom.com/main.php?p=home"><b><font color="#ffffff" face="Verdana" size="1">Home</font></b></a></p>
            </td>
            <td style="border-right: 1px solid rgb(153, 0, 0); height: 4px; text-align: center; background-color: rgb(204, 0, 0); width: 20%;">
            <p style="margin-top: 2px; margin-bottom: 2px;"><a href="http://rtjcom.com/main.php?p=down"><b><font color="#ffffff" face="Verdana" size="1">Downloads</font></b></a></p>
            </td>
            <td style="border-right: 1px solid rgb(153, 0, 0); height: 4px; text-align: center; background-color: rgb(204, 0, 0); width: 20%;">
            <p style="margin-top: 2px; margin-bottom: 2px;"><a href="http://rtjcom.com/main.php?p=about"><b><font color="#ffffff" face="Verdana" size="1">About Us</font></b></a></p>
            </td>
            <td style="border-right: 1px solid rgb(153, 0, 0); height: 4px; text-align: center; background-color: rgb(204, 0, 0); width: 20%;">
            <p style="margin-top: 2px; margin-bottom: 2px;"><a href="http://rtjcom.com/main.php?p=lic"><b><font color="#ffffff" face="Verdana" size="1">Licensing</font></b></a></p>
            </td>
            <td style="height: 4px; text-align: center; background-color: rgb(204, 0, 0); width: 20%;">
            <p style="margin-top: 2px; margin-bottom: 2px;"><a href="http://rtjcom.com/main.php?p=news"><b><font color="#ffffff" face="Verdana" size="1">News</font></b></a></p>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
    <tr>
      <td style="border-style: none; border-width: medium; border-left: medium none rgb(17, 17, 17); border-right: medium none rgb(17, 17, 17); width: 100%; height: 16px; background-color: rgb(255, 204, 102);">
      <table style="border-width: 0pt; border-collapse: collapse; width: 900px; height: 1px;" id="AutoNumber12" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td style="border-style: none; border-width: medium;" colspan="4" height="17" width="100%">
            <table style="border-width: 0pt; border-collapse: collapse; width: 900px;" id="AutoNumber16" border="1" bordercolor="#111111" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td style="border-style: none; border-width: medium;" colspan="3" bgcolor="#ffffff" width="100%">
                  <p style="margin-top: -5px; margin-bottom: -5px;">&nbsp;</p>
                  </td>
                </tr>
              </tbody>
            </table>
            </td>
          </tr>
          <tr>
            <td style="border-style: none; border-width: medium;" bgcolor="#ffffff" height="1" valign="top">
            <table style="border-collapse: collapse; width: 100%; height: 198px;" id="AutoNumber14" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td style="border-top: 1px solid rgb(192, 192, 192); border-left: 1px solid rgb(192, 192, 192); border-right: 1px solid rgb(192, 192, 192);" bgcolor="#ffcaca" height="19" valign="top" width="100%">
                  <p style="margin-top: 4px; margin-bottom: 4px;" align="center"><font face="Verdana" size="3"><b>Demo Applications for Embedded Artists' LPC2148 Education Board</b></font></p>
                  </td>
                </tr>
                <tr>
                  <td style="border-left: 1px solid rgb(192, 192, 192); border-right: 1px solid rgb(192, 192, 192); border-bottom: 1px solid rgb(192, 192, 192); vertical-align: top;" text-align="" left="" vertical-align="" top="">
                  <p style="margin: 10px;">
                  <font face="Verdana" size="2">
                  </font>
                  <small><span style="font-family: Verdana;">
<span style="font-weight: bold;">Released:</span>&nbsp;24 April 2006</span></small></p>
<p style="margin: 10px;"><span style="font-family: Verdana; font-weight: bold;"></span></p>
<p style="margin: 10px;"><span style="font-family: Verdana; font-weight: bold;">Contents</span></p>
<p style="margin: 10px 10px 10px 50px;">
<font face="Verdana" size="2">
<a href="#Rel">Release notes</a><br>
<a href="#Inst">Installation</a>
<br><a href="#SysReq">System requirements<br></a><a href="#Notes">Additional notes</a><br>
<a href="#Load">Loading and running the pre-compiled applications</a><br>
<a href="#CompJava">Compiling the test Java programs</a><br>
<a href="#CompSrtj">Compiling the simpleRTJ native code</a><br>
<a href="#Dbg">Debugging with <i>simple</i><b>RTJ</b></a><br>
</font>
<small><span style="font-family: Verdana;"></span></small></p>
<p style="margin: 10px;"><small><span style="font-family: Verdana;"></span><br style="font-family: Verdana;"><br style="font-family: Verdana;"><big><span style="font-family: Verdana; font-weight: bold;"><a name="Rel"></a>Release notes</span></big><br style="font-family: Verdana;"></small></p><ul><li><small><span style="font-family: Verdana;">This evaluation software is intended for use with&nbsp;Embedded Artists' <a href="http://embeddedartists.com/products/education/edu_base.php" target="_blank">LPC2148-Education Board</a>, however, </span></small><small><span style="font-family: Verdana;">the software can be easily adapted to other embedded systems&nbsp;</span></small><small><span style="font-family: Verdana;">based on&nbsp;Philips' LPC21xx processors.</span></small></li><li><small><span style="font-family: Verdana;">The RS-232 interface on UART0 is required&nbsp;to enable&nbsp;</span></small><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;">console input/output.</span></small></li><li><small><span style="font-family: Verdana;">In <span style="font-style: italic;">Control Panel/System/Advanced</span> create the user environment variable JDK_HOME and set it to your Java SDK root directory&nbsp;</span></small><small><span style="font-family: Verdana;">(ie. <span style="color: rgb(153, 0, 0);">JDK_HOME=c:\j2sdk1.4.2</span>)</span></small></li><li><small><span style="font-family: Verdana;">This
software comes with modified <span style="font-family: Courier New;">LPC21ISP.EXE</span> program that allows in system
programming of native code as well as uploading of Java applications at
pre-determined location in the LPC21xx flash memory.</span></small></li></ul><div style="margin-left: 40px;"><small><span style="font-family: Verdana;"><span style="font-weight: bold;">NOTE:</span> <span style="font-weight: bold;"><br>This software is not suitable for Philips LPC21xx devices that have less than 32KB of SRAM available for the application data. </span></span></small><br><small><span style="font-family: Verdana;"></span></small></div><p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;">&nbsp;</span></big></small></p><p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;"><a name="Inst"></a>Installation</span></big><span style="font-family: Verdana;"></span><br style="font-family: Verdana;"></small></p><div style="margin-left: 40px;"><small><span style="font-family: Verdana;">Extract downloaded zip archive into a directory of your choice. For example:&nbsp;</span><big><span style="color: rgb(0, 0, 0); font-family: monospace;">c:\srtj</span></big></small><br style="font-family: Verdana;"><small><span style="font-family: Verdana;">To uninstall, simply delete the directory where you have previously extracted <span style="font-style: italic;">simple</span><span style="font-weight: bold;">RTJ</span> files.</span></small><br style="font-family: Verdana;"></div><p style="margin: 10px;"><small>&nbsp;<br style="font-family: Verdana;"><big><span style="font-family: Verdana; font-weight: bold;"></span></big></small></p><p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;"><a name="SysReq"></a>System requirements</span></big><br style="font-family: Verdana;"></small></p><ul><li><small><span style="font-family: Verdana;">Host
PC with Windows 2000/XP and&nbsp;two serial ports. Two serial ports are only
required if you wish to debug Java applications via RS-232 connection.<br></span></small></li><li><small><span style="font-family: Verdana;">Sun Java SDK 1.3 (or higher) installed</span></small></li><li><small><span style="font-family: Verdana;">GNUARM with GCC 3.4.3 for building the native code.&nbsp; GNU tools are not required if you
only intend to create Java applications based on the supplied Java
packages. GNUARM with GCC 4.0.x was not tested with this package.<br></span></small></li><li><small><span style="font-family: Verdana;">LPC2148
Education Board with one RS-232 interface on UART0 for console input/output.
Second RS-232 interface on UART1 </span></small><small><span style="font-family: Verdana;">(ie. <a href="http://embeddedartists.com/products/education/edu_uart.php" target="_blank">RS-232 expansion board</a>) </span></small><small><span style="font-family: Verdana;">is required if you wish to debug
Java application via serial connection</span></small></li><li><small><span style="font-family: Verdana;">Embedded Artists'&nbsp;<span style="font-style: italic;">Quick Start Build Environment</span> <span style="font-style: italic;">v2.3.0.0 </span>installed.
This console based development environment is used to build
the&nbsp;native packages and also serves as a terminal console
window provided via <span style="font-family: Courier New;">LPC21ISP.EXE</span>.<br>Make sure you specify correct path&nbsp;</span></small><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;">to GNUGCC&nbsp;</span></small><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;">(COMPILERDIR2=) </span></small><small><span style="font-family: Verdana;">in <span style="color: rgb(0, 0, 0); font-style: italic;">build_environment.sh</span>.</span></small></li></ul>&nbsp;<p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;"></span></big></small><font face="Verdana"><strong><a name="Notes"></a>Additional
      notes</strong></font><font face="Verdana"><strong></strong></font><small><big><span style="font-family: Verdana; font-weight: bold;"></span></big><br style="font-family: Verdana;"></small></p><small><font color="#800000" face="Verdana" size="3"><small><em></em></small></font></small>

  
  
  
  
<ul><li><small><font face="Verdana">Download and read the <a target="_blank" href="http://rtjcom.com/main.php?p=down#Docs">Developer's
    Guide</a> for detailed description about the <strong><i style="font-weight: normal;">simple</i>RTJ</strong>
    operation and its components.</font>
  </small></li><li><small><font face="Verdana">When compiling Java files always use <font color="#800000">-bootclasspath</font>
    command line option. This switch will tell the Java compiler (javac) to use
    the java.lang package supplied with the <strong><i style="font-weight: normal;">simple</i>RTJ</strong>
    instead of standard one that comes with the JDK.&nbsp;</font>
  </small></li><li><small><font face="Verdana">When using JDK 1.4 or above add <font color="#800000">-target
    1.1</font> command line option for the javac compiler. This will tell the
    compiler to generate class files that are compatible with the <span style="font-style: italic;">simple</span><span style="font-weight: bold;">RTJ </span>VM. If
    the <font color="#800000">-target</font> command line option is omitted then
    the VM might not properly interpret the Java bytecodes.&nbsp;</font></small></li><li><small><font face="Verdana">When using JDK 1.5 or higher you will need to specify <span style="color: rgb(102, 0, 0);">-source 1.1</span> command line option.<br>

    &nbsp;</font>
  </small></li></ul>


  
  <p style="margin-left: 40px;"><small><font face="Verdana"><b>Notes for building <span style="font-style: italic;">simple</span>RTJ Java packages</b></font></small><small><font face="Verdana"><br></font></small></p><ul><ul><li><small><font face="Verdana">To build all at once run <font color="#800000"> make.bat</font>
from </font><big><span style="font-family: monospace;">lib-source-eval</span></big><font face="Verdana"> directory. This will compile all source java files
for all standard packages and will place the resulting jar files into </font><big><font style="color: rgb(0, 0, 0); font-family: monospace;" color="#0000ff"> ..\lib</font></big><font face="Verdana"> folder.&nbsp;</font></small></li><li><small><font face="Verdana">To build the <span style="font-weight: bold;">lpc2xxx</span> packages&nbsp;run <font color="#800000"> make-lpc2xxx.bat</font> from&nbsp;</font></small><small><big><span style="font-family: monospace;">lib-source-eval</span></big><font face="Verdana"> directory. The resulting jar package will be placed in&nbsp;</font></small><small><big><font style="color: rgb(0, 0, 0); font-family: monospace;" color="#0000ff">..\lib</font></big></small><small><font face="Verdana"> folder.</font></small></li><li><font face="Verdana"><small>To create new documentation for the standard and the lpc2xxx packages run
      <font color="#800000"> doc.bat</font></small></font></li></ul></ul>

  
  <p style="margin: 10px;"><span style="font-family: Verdana; font-weight: bold;">&nbsp;</span></p><p style="margin: 10px;"><span style="font-family: Verdana; font-weight: bold;"><a name="Load"></a>Loading and running the pre-compiled applications</span></p><ul><li><small><span style="font-family: Verdana;">Connect the console port UART0 on Education Board with the host PC using the serial cable</span></small></li><li><small><span style="font-family: Verdana;">Make
sure the jumpers J3,J4,J5 and J7 on&nbsp;</span></small><small><span style="font-family: Verdana;">Education Board</span></small><small><span style="font-family: Verdana;"> are closed to enable console
communication and in-system programming (ISP). Default console baud
rate is 38400 (limited by the LPC214x's boot loader). On the host PC you can use&nbsp;HyperTerminal (or
similar) and configure it for 38400,N,8,1. We recommend that for the
purpose of testing these demonstration applications you use provided
<span style="font-family: Courier New;">LPC21ISP.EXE</span>. This tool serves as ISP loader and is also used
as&nbsp;simple serial console terminal.</span></small></li><li><small><span style="font-family: Verdana;">There are two application image files you have to upload into the flash memory of Education Board's LPC2148:<br></span></small></li></ul><p style="margin: 10px 10px 10px 50px; font-weight: bold;"><small><span style="font-family: Verdana;"><a name="Loadsatrtup"></a>1. Native startup/JVM code</span></small></p><ul><ul><li><small><span style="font-family: Verdana;">Start Embedded Artists' console window and change directory to&nbsp;</span></small><span style="font-family: monospace;">simplertj-1.5\projects-lpc2xxx\native</span></li><li><small><span style="font-family: Verdana;">Connect RS-232 connector on the Education Board to a COM port on the host PC. By default COM1 is assumed by the build processes.<br></span></small></li><li><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;">Connect power to&nbsp;</span></small><small><span style="font-family: Verdana;">Education Board</span></small><small><span style="font-family: Verdana;"> and make sure the jumpers&nbsp;</span></small><small><span style="font-family: Verdana;">J3,J4,J5 and J7</span></small><small><span style="font-family: Verdana;"> are closed in order to invoke the in-system programming. When using USB cable to power the board close J45 jumper.<br></span></small></li><li><small><span style="font-family: Verdana;">In Embedded Artists' console window type the following command to upload <span style="font-style: italic;">srtj.hex</span> into the Education Board</span></small><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;">:<br></span><big style="color: rgb(51, 51, 153);"><span style="font-family: monospace;">&nbsp; &nbsp;&nbsp;deploy<br></span></big></small><small><span style="font-family: Verdana;">deploy batch file is configured to use <span style="font-family: Courier New;">LPC21ISP.EXE</span>&nbsp;(located in the root of&nbsp;</span><big style="color: rgb(0, 0, 0);"><span style="font-family: monospace;">simplertj-1.5</span></big><span style="font-family: Verdana;"> folder) on COM1 to program the flash memory on the Education Board board.</span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">Once
the programming is complete the <span style="font-family: Courier New;">LPC21ISP.EXE</span> will automatically start
the uploaded program and then switch to the terminal mode. As there are
no Java applications&nbsp;</span></span></span></small><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span></span></small><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">in the memory yet, </span></span></span></small><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"></span></span></span></small><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">you will see an error message.<br></span></span></span></small></li></ul></ul><small><span style="font-family: Verdana;"></span></small><p style="margin: 10px 10px 10px 50px;"><small style="font-weight: bold;"><span style="font-family: Verdana;">2. Java application binary images</span></small></p><p style="margin: 10px 10px 10px 50px;"><small><span style="font-family: Verdana;">The
LPC2148 comes with 512KB of flash memory that allows us to&nbsp;place
several Java applications at different memory locations. The native
startup code will search through the flash memory&nbsp;and display the
list of all available Java programs. Individual Java
applications are placed at 32KB offsets&nbsp;</span></small><small><span style="font-family: Verdana;">starting at 0x20000. There is a limit of 12 Java applications that can be concurrently present in the flash memory of LPC2148.<br>Software developers should keep track of Java application placement in the memory.</span></small><small style="font-weight: bold;"><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;"></span></small></p><ul><ul><li><small><span style="font-family: Verdana;">There are several pre-compiled Java application binary images in the </span><big><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx</span></big><span style="font-family: Verdana;"> folder. We will load twelve of them into the memory.</span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;"></span></big></span></span></span></small><br></li><li><small><span style="font-family: Verdana;">In Embedded Artists' console window change directory to&nbsp;</span></small><small><big><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx</span></big><span style="font-family: Verdana;"><span style="font-style: italic; color: rgb(153, 0, 0);">&nbsp;</span></span></small><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">and type the following command:<br></span></span></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; deployall -term<br></span></big></span></span></span></small><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">The deployall batch file will upload (via <span style="font-family: Courier New;">LPC21ISP.EXE</span>)&nbsp;<span style="font-style: italic;">.hex</span> images of Java applications into the LPC2148 flash memory starting at 0x20000.</span></span></span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">Once
the upload is complete the <span style="font-family: Courier New;">LPC21ISP.EXE</span> will automatically reset the Education Board and then switch to terminal mode.</span></span></span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">After
the reset the startup code will detect Java
applications located at 32K offsets starting at 0x20000.&nbsp;</span></span></span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">If
everything
went well you should see the list of all detected Java programs. Type
the letter corresponding to the Java application you wish to execute.
Native code will then activate JVM and you should see the&nbsp;messages
being displayed by the running
Java program.</span></span></span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">To load one Java application at the time navigate to the appropriate Java application folder (for example </span></span></span></small><small><span style="font-family: Verdana;"></span></small><small><big><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx\vmTests</span></big></small><small><span style="font-family: Verdana;"><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">) and type&nbsp;<br></span></span></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; deploy -term</span></big></span></span></span></small></li></ul></ul><ul><li><small><span style="font-family: Verdana;">The
<span style="font-family: Courier New;">LPC21ISP.EXE</span> provided with this software package is a modified version
of the software originally written by Martin Maurer. This program has
been modified to allow uploading data images for Philips devices at
addresses specified in the hex files. Additionally, the terminal mode
of this program is now ended by pressing the <span style="font-style: italic;">End</span> button on the keyboard.</span></small><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;"><br></span></small></li></ul><p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;">&nbsp; </span></big></small></p><p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;"><a name="CompJava"></a>Compiling the demo Java programs</span></big><br style="font-family: Verdana;"></small></p><ul><li><small><span style="font-family: Verdana;">The following Java demo programs are located in the </span></small><small><big><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx</span></big><span style="font-family: Verdana;"><span style="font-style: italic; color: rgb(153, 0, 0);"> </span></span></small><small><span style="font-family: Verdana;">directory:<br></span></small><ul><li><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"><span style="color: rgb(0, 0, 0);">Analog</span> </span></span></small><small><span style="font-family: Verdana;">- displays the voltage on AIN1 and AIN2. When J22 is closed the DAC output is also displayed via AIN3.</span></small><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"><span style="color: rgb(0, 0, 0);"></span></span></span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"><span style="color: rgb(0, 0, 0);">DemoDbg</span>&nbsp;</span></span></small><small><span style="font-family: Verdana;">- demonstration program used for evaluation of&nbsp;</span></small><a href="#Dbg"><small><font face="Verdana"><i>simple</i><span style="font-weight: bold;">RTJ</span>
Debugger</font></small></a></li><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">EmbeddedBenchMark</span> - a bench mark program based on <a href="http://www.imsys.se/" target="_blank">Bruce Boyes' code</a></span></small><small><span style="font-family: Verdana;">. Due to the limited amount of heap memory the chunk size has been reduced to 0x400.</span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"><span style="color: rgb(0, 0, 0);">GPIO-LCD</span> </span></span></small><small><span style="font-family: Verdana;">-
demonstrates the use of lpc2xxx.LCD class for displaying the messages
on 2x16 LCD panel. A 4-bit interface to LCD panel is used to free five
GPIO pins for other use.</span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"></span></span></small><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">I2C-Eeprom</span> - using the I<sup>2</sup>C
interface this program demonstrates how to read/write the 2 kbit (256
byte)&nbsp;serial EEPROM (CAT1025) located on the Education Board board.</span></small></li><li><small><span style="font-family: Verdana;"> <span style="font-weight: bold; color: rgb(0, 0, 0);">LEDSwing</span><span style="font-weight: bold;"> </span>-
demonstrate the use of GPIO pins from within Java application to
control a series of 8 LEDs connected to P0.8-15. For this program to
work you must remove DC motor jumpers J49, J51 and J53.</span></small></li><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">PWM-Buzzer</span> - demonstrate the use of PWM2 module to control the buzzer on the board</span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"><span style="color: rgb(0, 0, 0);">PWM-DCMotor</span> </span></span></small><small><span style="font-family: Verdana;">- controls the&nbsp;</span></small><small><span style="font-family: Verdana;">DC motor's</span></small><small><span style="font-family: Verdana;"> direction and rotational speed. </span></small><small><span style="font-family: Verdana;">Jumpers J49, J51 and J53 must be closed. <br>Note that motor will start to spin in either direction at about 40% PWM duty.</span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"><span style="color: rgb(0, 0, 0);">PWM-RGB</span> </span></span></small><small><span style="font-family: Verdana;">-
you can use joystick to change the brightness of tri-color LED. A demo
mode is automatically started after 20 seconds of inactivity.</span></small></li><li><small><span style="font-family: Verdana;"><span style="color: rgb(0, 102, 0); font-weight: bold;"><span style="color: rgb(0, 0, 0);">PWM-Servo</span> </span></span></small><small><span style="font-family: Verdana;">- using PWM2 you can control the position of a servo motor connected to J55.&nbsp;</span></small></li><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">RealTimeClock</span> - allows you to show/set the date/time of the LPC21xx's on-chip RTC</span></small></li><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">Serial</span> - demonstrates the use of UART0/1 from within the Java program</span></small></li></ul><small><span style="font-family: Verdana;"> </span></small><ul><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">SimpleBenchmark</span><span style="font-weight: bold;"> </span>- executes 100 second long performance tests (Sieve, String, Math, Logic, Loop)</span></small></li></ul><ul><li><small><span style="font-family: Verdana;"></span><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">Sort</span> - measures the time it takes to sort complex set of data records in memory</span></small></li><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">SPI-LEDMatrix</span>
- displays the scrolling alphabet (or custom text) on the 8x8 LED matrix.</span></small></li></ul><ul><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">ThreadSequencingTest</span> - tests the proper function of VM thread scheduler</span></small></li></ul><ul><li><small><span style="font-family: Verdana;"><span style="font-weight: bold; color: rgb(0, 0, 0);">vmTests</span> - basic regression tests for the VM</span></small></li></ul></li><li><small><span style="font-family: Verdana;">In Embedded Artists' console window&nbsp;</span></small><small><span style="font-family: Verdana;">navigate to the directory of Java program you wish to compile</span></small></li><li><small><span style="font-family: Verdana;">type <br></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; make</span></big></span></span></span></small><small><span style="font-family: Verdana;"><span style="font-family: Courier New;"></span><br></span></small><small><span style="font-family: Verdana;">This should do the following:</span><br style="font-family: Verdana;"><span style="font-family: Verdana;">- compile the Java source files with javac</span><br style="font-family: Verdana;"><span style="font-family: Verdana;">- link the class files with ClassLinker (the .bin and .hex files are created)</span></small></li><li><small><span style="font-family: Verdana;">to transfer the Java program into LPC2148 type:<br></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; deploy</span></big></span></span></span></small></li><li><small><span style="font-family: Verdana;">to transfer the Java program into LPC2148 and see it running in the terminal window type:<br></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; deploy -term<br></span></big></span></span></span></small><small><span style="font-family: Verdana;">This assumes that you have already programmed flash in LPC2148 with the <a href="#Loadsatrtup">startup/JVM</a> code.</span></small></li><li><small><span style="font-family: Verdana;">to re-compile all Java applications navigate to </span></small><small><big><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx</span></big><span style="font-family: Verdana;"><span style="font-style: italic; color: rgb(153, 0, 0);"> </span></span></small><small><span style="font-family: Verdana;">directory and type:<br></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; makejava</span></big></span></span></span></small></li></ul><div style="margin-left: 40px;"><small style="font-family: Verdana;"><span style="font-weight: bold;">Notes:</span>
<br></small><ul><li><small style="font-family: Verdana;">When using any of the above Java programs that control peripheral
devices (PWM, SPI, GPIO, etc.) always make sure the corresponding jumpers on
the prototyping board are closed/open according to documentation.</small></li><li><small style="font-family: Verdana;">DC motor </small><small style="font-family: Verdana;">jumpers</small><small style="font-family: Verdana;"> (</small><small><span style="font-family: Verdana;">J49,
J51 and J53) should be removed for all Java programs using P0.8, P0.9
and P0.10. This will prevent board from restarting (due to current
overload) when invalid values are applied to the DC motor controller
pins.</span></small></li><li><small><span style="font-family: Verdana;">When using DC or&nbsp;</span></small><small><span style="font-family: Verdana;">servo </span></small><small><span style="font-family: Verdana;">
motor applications it is recommended to use DC plug to power the
Education Board. The USB connection may not always provide sufficient
power for the higher current devices on the board. The insufficient
current supply is usually demonstrated by a spontaneous reset.<br></span></small></li></ul></div><p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;">&nbsp;</span></big></small></p><p style="margin: 10px;"><small><big><span style="font-family: Verdana; font-weight: bold;"><a name="CompSrtj"></a>Compiling the simpleRTJ native code</span></big><br style="font-family: Verdana;"></small></p><div style="margin-left: 40px;"><small><span style="font-family: Verdana;"></span></small><small><span style="font-family: Verdana;">Java
applications are executed via ARM7-TDMI native program. This program is
located in the </span><big><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx\native</span></big><span style="font-family: Verdana;"> folder. The <span style="font-style: italic;">simple</span><span style="font-weight: bold;">RTJ</span> native code consists of </span></small><small><span style="font-family: Verdana;">several modules that: </span></small><br style="font-family: Verdana;"><ul><li><small><span style="font-family: Verdana;">initialize the LPC21xx hardware peripherals(UARTs, timers, VIC,...)</span></small><small><span style="font-family: Verdana;"></span></small></li><li><small><span style="font-family: Verdana;">Java VM that executes the Java applications (vm.a, vmdbg.a) </span></small></li><li><small><span style="font-family: Verdana;">provide support for the Java native methods defined in the class packages</span></small></li><li><small><span style="font-family: Verdana;">support debugging of Java programs via serial port (provided RS-232 is available on UART1)<br></span></small></li></ul><small><span style="font-family: Verdana;">To compile the <span style="font-style: italic;">simple</span><span style="font-weight: bold;">RTJ</span> native code:</span></small><br style="font-family: Verdana;"><ul><li><small><span style="font-family: Verdana;">you
must have GNUARM with GCC 3.4.3&nbsp;installed on your PC in order to
rebuild the native code. GNUARM 4.0.x has not been tested with this
software.</span></small><small><span style="font-family: Verdana;"></span></small></li><li><small><span style="font-family: Verdana;">In Embedded Artists' console window </span></small><small><span style="font-family: Verdana;">navigate to&nbsp;</span></small><span style="font-family: monospace;">projects-lpc2xxx\native</span><small><span style="font-family: Verdana;"> folder and </span></small><small><span style="font-family: Verdana;">type:<br></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; make clean<br></span></big></span></span></span></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; make all</span></big></span></span></span></small></li><li><small><span style="font-family: Verdana;">The make script is configured to include the following folders in the build process:<br></span><big><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\vm-arm</span><br style="color: rgb(0, 0, 0); font-family: monospace;"><span style="color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx\native</span><br style="color: rgb(0, 0, 0); font-family: monospace;"></big></small><span style="font-family: monospace;">simplertj-1.5\projects-lpc2xxx\native\startup</span></li></ul><small><span style="font-family: Verdana; font-weight: bold;">Note:</span><span style="font-family: Verdana;"> Do not delete the following files as these are provided only in the binary form as&nbsp;libraries:<br></span></small><div style="margin-left: 40px; color: rgb(0, 0, 0); font-family: monospace;">simplertj-1.5\projects-lpc2xxx\native\dbg.a<br>simplertj-1.5\vm-arm\vmdbg.a</div><small><span style="font-family: Verdana;"></span></small><span style="font-weight: bold;"></span><small><span style="font-family: Verdana; font-weight: bold;"></span></small></div>&nbsp;<p style="margin: 10px;"><span style="font-family: Verdana; font-weight: bold;"><a name="Dbg"></a>Debugging with the <span style="font-style: italic;">simple</span>RTJ</span></p><blockquote><small>
  </small><p><small>
<font face="Verdana">The DemoDbg java program for the <b><i>simple</i>RTJ
Debugger</b> allows you to evaluate debugger features that include:</font>
  </small></p><small>
  </small><ul><li><small><font face="Verdana">single
	step code tracing</font> 
    </small></li><li><small><font face="Verdana">program
	Run/Pause/Reset</font> 
    </small></li><li><small><font face="Verdana">multiple
	breakpoints with pass count and thread assignment</font> 
    </small></li><li><small><font face="Verdana">class
	static and method local variables inspection</font>
    </small></li><li><small><font face="Verdana">object
	fields inspection with fields lookup </font>
    </small></li><li><small><font face="Verdana">symbol
	watch</font>
    </small></li><li><small><font face="Verdana">multi-threaded
	debugging</font>
    </small></li><li><small><font face="Verdana">and more...</font></small><small>&nbsp;</small></li></ul><small>
</small></blockquote>

<blockquote><small>
</small><p style="font-weight: bold;"><small><font face="Verdana">Limitations
imposed on the evaluation version of simpleRTJ Debugger</font> 
</small></p><small>
  </small><ul><li><small><font face="Verdana">debugger
	will only open debug project file named <font color="#800000">DemoDbg.debug</font></font>
    </small></li><li><small><font face="Verdana">DemoDbg
	project can only contain one source file <font color="#800000">DemoDbg.java</font></font>
    </small></li><li><small><font face="Verdana">only
	three classes can be present in DemoDbg.java</font>
    </small></li><li><small><font face="Verdana"><font color="#800000">sdbgAsync</font>
	driver is limited to 9600 buad</font>
    </small></li><li><small><font face="Verdana"><font color="#800000">sdbgIP</font>
	driver can only be set for debugging on local networks (192.168.x.x
	or 127.x.x.x)<br>&nbsp;</font>
    </small></li></ul><small>
</small></blockquote>
<blockquote><small>
</small><small>
</small><p><small><b><font face="Verdana">Compiling </font><font face="Courier New">projects-lpc2xxx\DemoDbg</font></b></small></p><small>
</small><blockquote style="font-family: Verdana;"><small>
  You must have JDK1.3 or above
properly installed on your computer.&nbsp;
  </small><p><small>To recompile the debugger's test java
	application run <font color="#800000"> make.bat</font> from 
  <big><font style="color: rgb(0, 0, 0); font-family: monospace;" color="#0000ff">simplertj-1.5\projects-lpc2xxx\DemoDbg</font></big>
	directory.&nbsp;<br>The following happens:</small></p><small>
  </small><ul><li><small>all
	java files are compiled with the java compiler.</small></li><li><small>all
	class files produced during the compilation are linked together
	with the library packages and an output files (DemoDbg.bin and DemoDbg.debug)
      are produced.&nbsp;</small></li></ul></blockquote><small><b><font face="Verdana">Running </font><font face="Courier New">projects-lpc2xxx\DemoDbg</font></b></small><small>
</small></blockquote>
<div style="margin-left: 40px;"><div style="margin-left: 40px;"><small><font face="Verdana">Demonstration application comes with the pre-compiled binaries. To upload DemoDbg into the Education Board type<br></font></small><small><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="font-family: monospace; color: rgb(51, 51, 153);"><big><span style="font-family: monospace;">&nbsp; &nbsp; deploy -term</span></big></span></span></span></small><br><small><font face="Verdana"><span style="font-style: italic;"></span>The startup/JVM code must be already loaded and built with the JVM debugging enabled (</font><big><span style="color: rgb(0, 0, 0); font-family: monospace;">vm-arm\javavm.h</span></big><font face="Verdana"> must have ENABLE_REMDBG set to 1).<br></font></small></div><small>
  </small></div><div style="margin-left: 80px; font-family: Verdana;"><small>On the&nbsp;console window </small><small><font face="Verdana">you should o see
  the following:
</font></small></div><blockquote style="margin-left: 80px;"><p style="margin-left: 40px;"><small><font face="Courier New">SRTJ - with JVM debugging enabled<br><br>Time slice: 1<br>Heap:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00006000<br>References: 600<br>Strings:&nbsp;&nbsp;&nbsp; 100<br>Threads:&nbsp;&nbsp;&nbsp; 8<br>Sw. timers: 4</font></small><small><span style="font-family: Verdana;"></span></small><small><font face="Courier New"><br><br>A - Test Program for Debugger&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 00020000<br>...</font></small></p></blockquote><p style="margin-left: 80px;"><small>To start DemoDbg program press <span style="font-style: italic;">A</span>. You will be then asked if you wish to run the program in a debug mode. Press <span style="font-style: italic;">Y</span> and the following will be displayed:</small></p><blockquote style="margin-left: 80px;"><p style="margin-left: 40px;"><small><font face="Courier New">Run Java application in debug mode? [Y/N]: Y<br>Debug link on UART1 (9600 baud) activated<br>Starting: DemoDbg<br>Notify: 0x81 - Initialising VM<br>Notify: 0x85 - DBG active, waiting for host</font></small></p><small>
  </small><small><font face="Verdana">At this point the DemoDbg is ready for debugging and the VM is&nbsp;waiting for the remote debugger to initiate the debugging
  session.&nbsp;</font></small></blockquote>
<blockquote><small>
  </small><small>
  </small><p><small><b><font face="Verdana">Debugging the test program with simpleRTJ Debugger</font></b></small><font face="Verdana"></font></p><small>
  </small><ul><li style="font-family: Verdana;"><small>Download the <b><i>simple</i>RTJ
      Debugger</b> installation file from <a href="http://rtjcom.com/downfile.php?f=srtjdbg">here</a><br></small></li><li style="font-family: Verdana;"><small>Install the debugger by executing the downloaded
      file<br></small></li><li style="font-family: Verdana;"><small>Build the Java test program as described in the
      previous sections (you can omit this step if you want to use the pre-built
      binaries that come in the distribution file)<br></small></li><li style="font-family: Verdana;"><small>Start the DemoDbg test Java program running as described
      above.&nbsp;<br></small></li><li style="font-family: Verdana;"><small>In the windows explorer navigate to the <big><font style="color: rgb(0, 0, 0); font-family: monospace;" color="#800000">simplertj-1.5\projects-lpc2xxx\DemoDbg</font></big><span style="font-style: italic;">
     </span> directory&nbsp;<br></small></li><li style="font-family: Verdana;"><small>Double-click the debug project file <font color="#800000">DemoDbg.debug.
      </font>This will start the <span style="font-style: italic;">simple</span><span style="font-weight: bold;">RTJ</span> Debugger and loads the debug project
      file. The cursor will be placed on the first execution line of the main
      method.<br></small></li><li style="font-family: Verdana;"><small>From the debugger menu select <font color="#800000">File|Connect
      to target</font> or press F2. If this is the first time after the debugger
      was installed it will ask you if you wish to select the communication
      driver. Choose Yes and the Preferences screen will open. From the <font color="#800000">Comm
      plug-in</font> drop-down list select <font color="#800000">sdbgAsync</font>
and click Setup button to configure the driver. Choose the correct baud rate (max. 9600 on eval. version).
Click Ok to close the sdbgAsync setup screen and then Ok again to close
the preferences screen. The debugger will now try to connect with the
VM.<br></small></li><li style="font-family: Verdana;"><small>Upon successful connection the debugger will open VM
      runtime configuration screen.&nbsp;<br></small></li><li><small><font face="Verdana"><span style="font-family: Verdana;">Now you are free to use any of the debugging commands to
      navigate trough the Java program.</span><br></font></small></li></ul><small><font face="Verdana">Please read the documentation that comes with the
  debugger to learn in detail about its operation.</font></small><small>
</small></blockquote>

  <p style="margin: 10px;"></p>
                  </td>
                </tr>
              </tbody>
            </table>
            </td>
          </tr>
          <tr>
            <td style="border-style: none; border-width: medium;" colspan="4" bgcolor="#ffffff" height="1" valign="top" width="100%">
            <p style="margin-top: -5px; margin-bottom: -5px;">&nbsp;</p>
            </td>
          </tr>
          <tr>
            <td style="border-style: none; border-width: medium;" colspan="4" bgcolor="#ff0000" height="3" valign="top" width="100%">
            <p style="margin-top: -5px; margin-bottom: -5px;">&nbsp;</p>
            </td>
          </tr>
          <tr>
            <td style="border-style: none; border-width: medium; text-align: right;" colspan="4" bgcolor="#990000" height="17" width="100%">
            <p style="margin-top: 5px; margin-bottom: 5px;"><font style="color: rgb(255, 255, 255);" face="Verdana"><small><small>
Copyright &copy; 2000-2006, </small></small><b><font size="2">RTJ Computing. </font></b><small><small>
All rights reserved.</small></small></font></p>
            </td>
          </tr>
          <tr>
            <td colspan="4" style="border-style: none; border-width: medium; width: 100%; height: 17px; text-align: right; background-color: rgb(255, 255, 255);">
            <p style="margin-top: 5px; margin-bottom: 5px;"><font style="color: rgb(0, 0, 0);" face="Verdana"><small><small>
Java and all Java-based marks are trademarks or registered trademarks of Sun
Microsystems, Inc., and all other<br>
trademarks and logos are trademarks or registered trademarks of their
respective owners. </small></small></font></p>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
  </tbody>
</table>
<br>
</body></html>